﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SWENAssignment
{
    public partial class HousekeepingLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            if (tbxLoginID.Text == "")
            {
                lblLoginError.Visible = true;
            }
            if (tbxPassword.Text == "")
            {
                lblPasswordError.Visible = true;
            }
            if (tbxLoginID.Text != "" && tbxPassword.Text != "" && DBmanager.Login(tbxLoginID.Text, tbxPassword.Text) == true)
            {
                Response.Redirect("createStaffProfile1.aspx");
                Session["loginID"] = tbxLoginID.Text;
            }
            else
            {
                lblStatus.Text = "Login Failed";
            }
        }
    }
}